<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>图片裁剪</title>
    <link rel="stylesheet" type="text/css" href="../example.css" />
</head>
<body class="yui-skin-315 yui-skin-sam">

<div id="doc4">
  <div class="hd">
    <div class="hd-title">image cropper example:</div>
    <div class="hd">
      <div>
        <button id="test1">弹出</button>
        <button id="test2">页面</button>
      </div>
      <div id="container">
      </div>
    </div>
    <h1>code:</h1>
<pre>
更多API请参见：<a href="../jsdoc/symbols/__.widget.ImgCropper.html" target="_blank">../jsdoc/symbols/__.widget.ImgCropper.html</a>

调用ImgUploader后直接裁剪请参见：<a href="../imguploader/demo.html" target="_blank">../imgcropper/demo.html</a>

__.load(['imgcropper'], function() {
  new __.widget.ImgCropper('container', 'http://stauren.com/uploads/agirl.jpg', {
    onOk : function(o){alert(_.dump(o), true)},
    popup : true,
    windowX : 280,
    windowY : 210,
    canvasX : 450,
    canvasY : 300
  });
});
</pre>
  </div>
</div>
<script>
__ = {
  cfg : [undefined, true, '0', 'http://localhost/att/workspace/os/svn']
};
</script>
<script src="http://localhost/att/workspace/os/svn/trunk/src/loader/loader.js"></script>
<script>
__.load('yui core imgcropper', function() {
  var _ = __._;
  _.on('test1', 'click', function() {
    new __.widget.ImgCropper('container', 'http://stauren.com/uploads/agirl.jpg', {
      onOk : function(o){alert(_.dump(o), true)},
      popup : true,
      windowX : 280,
      windowY : 210,
      canvasX : 450,
      canvasY : 300
    });
  });
  _.on('test2', 'click', function() {
    new __.widget.ImgCropper('container', 'http://stauren.com/uploads/agirl.jpg', {
      onOk : function(o){alert(_.dump(o), true)},
      popup : false,
      windowX : 280,
      windowY : 210,
      canvasX : 450,
      canvasY : 300
    });
  });
});
</script>
</body>
</html>

